CentOS 7安装Docker处事具体进程
操纵系统级虚拟化, cmd 它将执行任何呼吁当docker容器将被执行,并将其添加为容器的新映像,客户操纵系统无需举办修改,并利用80端口启动httpd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 [root@linuxprobe ~]# vim dockerfile # create new from centos maintainer linuxprobe [email protected] run yum -y install httpd run echo hello linuxprobe dockerfile /var/www/html/index.html expose 80 cmd [-d,如下所示,kvm等 部门虚拟化。
然后宣布到任何风行的 linux 呆板上。
最初提倡者是dotcloud公司。
[add]的区别是,并将其标志为从本机主机或其他容器生存外部装入的卷 user它配置用户名或uid,一台主机上面可以运行数千个docker容器 docker通过雷同git的操纵来利便用户获取、漫衍和更新应用镜像,到达应用组件级此外一次封装。
key id f4a80eb5: nokey public key for apr-util-1.5.2-6.el7.x86_64.rpm is not installed public key for httpd-tools-2.4.6-40.el7.centos.4.x86_64.rpm is not installed -------------------------------------------------------------------------------- total 382 kb/s | 24 mb 01:05 retrieving key from file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7 importing gpg key 0xf4a80eb5: userid : centos-7 key (centos 7 official signing key) [email protected] fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5 package : centos-release-7-2.1511.el7.centos.2.10.x86_64 (@centos) from : /etc/pki/rpm-gpg/rpm-gpg-key-centos-7 running transaction check running transaction test transaction test succeeded running transaction installing : apr-1.4.8-3.el7.x86_64 1/6 installing : apr-util-1.5.2-6.el7.x86_64 2/6 installing : httpd-tools-2.4.6-40.el7.centos.4.x86_64 3/6 installing : centos-logos-70.0.6-3.el7.centos.noarch 4/6 installing : mailcap-2.1.41-2.el7.noarch 5/6 installing : httpd-2.4.6-40.el7.centos.4.x86_64 6/6 verifying : apr-1.4.8-3.el7.x86_64 1/6 verifying : httpd-tools-2.4.6-40.el7.centos.4.x86_64 2/6 verifying : apr-util-1.5.2-6.el7.x86_64 3/6 verifying : httpd-2.4.6-40.el7.centos.4.x86_64 4/6 verifying : mailcap-2.1.41-2.el7.noarch 5/6 verifying : centos-logos-70.0.6-3.el7.centos.noarch 6/6 installed: httpd.x86_64 0:2.4.6-40.el7.centos.4 dependency installed: apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7 centos-logos.noarch 0:70.0.6-3.el7.centos httpd-tools.x86_64 0:2.4.6-40.el7.centos.4 mailcap.noarch 0:2.1.41-2.el7 complete! --- 3ce9abf4dfea removing intermediate container 3d37e4919fa9 step 4 : run echo hello linuxprobe dockerfile /var/www/html/index.html --- running in 297d8d666c8d --- 3d185363045b removing intermediate container 297d8d666c8d step 5 : expose 80 --- running in 017db517e06a --- 5c855e478c3c removing intermediate container 017db517e06a step 6 : cmd -d foreground --- running in 6add13fca3cb --- 7a219d9fa6e1 removing intermediate container 6add13fca3cb step 7 : entrypoint /usr/sbin/httpd --- running in da4671709ee1 --- c0d84e256068 removing intermediate container da4671709ee1 successfully built c0d84e256068 [root@linuxprobe ~]# docker images repository tag image id created size docker.io/centos latest 0584b3d2cf6d less than a second ago 196.5 mb web_server latest c0d84e256068 36 seconds ago 338.3 mb my_image/centos_httpd latest b0be2940865a 4 hours ago 338.3 mb [root@linuxprobe ~]# docker run -d -p 80:80 web_server c37d25a405a8e0599bf54fe77d78c807a520242a21ccb15b18d6b6ee4d13415b [root@linuxprobe ~]# docker ps container id image command created status ports names c37d25a405a8 web_server /usr/sbin/httpd -d f 6 seconds ago up 5 seconds 0.0.0.0:80-80/tcp condescending_knuth 2f0d06526d42 my_image/centos_httpd /bin/bash about an hour ago up about an hour 0.0.0.0:8081-80/tcp hopeful_gat 。
降生于2013年头,请按ctrl + p和ctrl + q键 1 2 3 4 5 6 7 8 9 10 [root@linuxprobe ~]# docker run -i -t centos /bin/bash [root@a05c7fd0a54f /]# [root@linuxprobe ~]# [root@linuxprobe ~]# docker ps container id image command created status ports names a05c7fd0a54f centos /bin/bash 24 seconds ago up 23 seconds trusting_fermat [root@linuxprobe ~]# docker attach a05c7fd0a54f # connect docekr process [root@a05c7fd0a54f /]# [root@linuxprobe ~]# docker kill a05c7fd0a54f # kill docker process a05c7fd0a54f [root@linuxprobe ~]# docker ps # 查察运行的docker处事 container id image command created status ports names docker:添加镜像 在容器中添加镜像文件 比方,客户机操纵系统需要举办变动。
让开拓者可以打包他们的应用以及依赖包到一个可移植的容器中, 只针对部门硬件资源举办虚拟化。
docker 是一个开源的应用容器引擎,提高事情效率 1.3、虚拟化与docker 虚拟化是一个通用的观念,比方xen,对比传统的虚拟机方法快许多 docker容器对系统资源需求很少, 比方, docker中文社区 docker的主要方针是build。
目次或长途文件url, 超虚拟化。
更快速地的交付和陈设,它将执行任何呼吁,该容器是在每次执行docker run呼吁时生成的,同时带来低落本钱。
利便打点和容错容灾,平台虚拟化又细分如下几个子类: 完全虚拟化,既可以是一个web应用,多次运行,则container的历程完成 1 2 3 4 5 6 [root@linuxprobe ~]# docker run -i -t centos /bin/bash [root@82699d79557c /]# uname -a linux 82699d79557c 3.10.0-327.el7.x86_64 #1 smp thu nov 19 22:10:57 utc 2015 x86_64 x86_64 x86_64 gnu/linux [root@82699d79557c /]# exit exit [root@linuxprobe ~]# #back 假如从容器会话中退出并保持容器的历程,可以轻松的为任何应用建设一个轻量级的、可移植的、自给自足的容器, 部门硬件接口以软件的形式提供应客户机操纵系统, run 当建设docker镜像时。
label 它向图像添加元数据, volume 它建设具有指命名称的装入点, 更高效的资源操作 更轻松的更新陈设 更简朴的更新打点 docker与虚拟机较量 docker容器很快。
qemu等 硬件帮助虚拟化,在计较机规模,指令简朴。
add 它复制新文件, Docker 官网: Docker 官方文档: https://docs.docker.com/ Docker Github 地点: https://github.com/docker/docker Docker 客栈: https://hub.docker.com/ Docker 中文社区: Docker 应用场景: https://www.zhihu.com/question/22969309 1.1、什么是docker? docker是基于go语言实现的云开源项目,客户端操纵系统需要举办变动,在不通规模有着差异的领略,方针往往是为了在同一主机上运行多个操纵系统或应用, copy 它复制新的文件或目次,请参阅instruction的以下说明,因此添加最新执行的容器如下 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [root@linuxprobe ~]# docker images repository tag image id created size docker.io/centos latest 0584b3d2cf6d less than a second ago 196.5 mb # start a container and install httpd [root@linuxprobe ~]# docker run centos /bin/bash -c yum -y update; yum -y install httpd [root@linuxprobe ~]# docker ps -a | head -2 container id image command created status ports names f36383194ad4 centos /bin/bash -c yum -y 2 minutes ago exited (0) 45 seconds ago jolly_cray elegant_wright [root@linuxprobe ~]# docker commit f36383194ad4 my_image/centos_httpd [root@linuxprobe ~]# docker images repository tag image id created size docker.io/centos latest 0584b3d2cf6d less than a second ago 196.5 mb my_image/centos_httpd latest b0be2940865a 7 seconds ago 338.3 mb 会见容器 1 2 3 4 5 6 7 8 9 10 11 12 13 root@linuxprobe ~]# docker run -it -p 8081:80 my_image/centos_httpd /bin/bash [root@2f0d06526d42 /]# /usr/sbin/httpd [1] 14 [root@2f0d06526d42 /]# ah00558: httpd: could not reliably determine the servers fully qualified domain name。
虚拟化的焦点是对资源举办抽象, ovl determining fastest mirrors * base: mirrors.163.com * extras: ftp.sjtu.edu.cn * updates: mirrors.163.com resolving dependencies -- running transaction check --- package httpd.x86_64 0:2.4.6-40.el7.centos.4 will be installed -- processing dependency: httpd-tools = 2.4.6-40.el7.centos.4 for package: httpd-2.4.6-40.el7.centos.4.x86_64 -- processing dependency: system-logos = 7.92.1-1 for package: httpd-2.4.6-40.el7.centos.4.x86_64 -- processing dependency: /etc/mime.types for package: httpd-2.4.6-40.el7.centos.4.x86_64 -- processing dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64 -- processing dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-40.el7.centos.4.x86_64 -- running transaction check --- package apr.x86_64 0:1.4.8-3.el7 will be installed --- package apr-util.x86_64 0:1.5.2-6.el7 will be installed --- package centos-logos.noarch 0:70.0.6-3.el7.centos will be installed --- package httpd-tools.x86_64 0:2.4.6-40.el7.centos.4 will be installed --- package mailcap.noarch 0:2.1.41-2.el7 will be installed -- finished dependency resolution dependencies resolved ================================================================================ package arch version repository size ================================================================================ installing: httpd x86_64 2.4.6-40.el7.centos.4 updates 2.7 m installing for dependencies: apr x86_64 1.4.8-3.el7 base 103 k apr-util x86_64 1.5.2-6.el7 base 92 k centos-logos noarch 70.0.6-3.el7.centos base 21 m httpd-tools x86_64 2.4.6-40.el7.centos.4 updates 83 k mailcap noarch 2.1.41-2.el7 base 31 k transaction summary ================================================================================ install 1 package (+5 dependent packages) total download size: 24 m installed size: 31 m downloading packages: warning: /var/cache/yum/x86_64/7/base/packages/apr-util-1.5.2-6.el7.x86_64.rpm: header v3 rsa/sha256 signature,或处事器虚拟化,比方vmware workstation,彼此之间不会有任何接口。
容器是完全利用沙箱机制,它可以在containers中自动陈设应用措施 安装docker 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [root@linuxprobe~]# yum -y install docker [root@linuxprobe~]# systemctl start docker [root@linuxprobe~]# systemctl enable docker [root@linuxprobe ~]# systemctl status docker # 查察docker状态 ● docker.service - docker application container engine loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) active: active (running) since wed 2016-10-26 19:38:40 cst; 12s ago docs: http://docs.docker.com main pid: 3762 (docker-current) cgroup: /system.slice/docker.service └─3762 /usr/bin/docker-current daemon --exec-opt native.cgroupdriver=systemd --selinux-enabled --log-driver=journald oct 26 19:38:39 linuxprobe.org docker-current[3762]: time=2016-10-26t19:38:39.844803185+08:00 level=info msg=devmapper: successfully created filesystem xfs on device docker-253:0-104354176-base oct 26 19:38:39 linuxprobe.org docker-current[3762]: time=2016-10-26t19:38:39.994708787+08:00 level=info msg=graph migration to content-addressability took 0.00 seconds oct 26 19:38:40 linuxprobe.org docker-current[3762]: time=2016-10-26t19:38:40.018129400+08:00 level=info msg=firewalld running: true oct 26 19:38:40 linuxprobe.org docker-current[3762]: time=2016-10-26t19:38:40.294869786+08:00 level=info msg=default bridge (docker0) is assigned with an ip address 172.17.0.0/16. daemon option --bip can ...red ip address oct 26 19:38:40 linuxprobe.org docker-current[3762]: time=2016-10-26t19:38:40.567994904+08:00 level=info msg=loading containers: start. oct 26 19:38:40 linuxprobe.org docker-current[3762]: time=2016-10-26t19:38:40.568039413+08:00 level=info msg=loading containers: done. oct 26 19:38:40 linuxprobe.org docker-current[3762]: time=2016-10-26t19:38:40.568047306+08:00 level=info msg=daemon has completed initialization oct 26 19:38:40 linuxprobe.org docker-current[3762]: time=2016-10-26t19:38:40.568058527+08:00 level=info msg=docker daemon commit=cb079f6-unsupported execdriver=native-0.2 graphdriver=devicemapper version=1.10.3 oct 26 19:38:40 linuxprobe.org docker-current[3762]: time=2016-10-26t19:38:40.572491688+08:00 level=info msg=api listen on /var/run/docker.sock oct 26 19:38:40 linuxprobe.org systemd[1]: started docker application container engine. hint: some lines were ellipsized,docker技能,ship and run any app anywhere,建设一个dockerfile来安装httpd并添加index.html, ctrl+q [root@2f0d06526d42 /]# [root@linuxprobe ~]# docker ps container id image command created status ports names 2f0d06526d42 my_image/centos_httpd /bin/bash 54 seconds ago up 52 seconds 0.0.0.0:8081-80/tcp hopeful_gates [root@linuxprobe ~]# docker ps -a | head -2 container id image command created status ports names 2f0d06526d42 my_image/centos_httpd /bin/bash 27 minutes ago up 27 minutes 0.0.0.0:8081-80/tcp hopeful_gates 客户端欣赏器会见 docker:利用dockerfile 利用dockerfile并自动建设docker镜像 [1] dockerfile的名目是[instruction arguments],这里的应用组件,甚至是一个操纵系统或编辑器, workdir 它配置事情目次, 虚拟机模仿完整的底层硬件情况和特权指令的执行进程, expose 它通知docker容器将在运行时侦听指定的网络端口,包罗vms(虚拟机)、bare metal、openstack 集群和其他的基本应用平台, use -l to show in full. 下载官方镜像并建设一个container,一般是指计较虚拟化(computing virtualization),利用更新官方映像安装httpd,正确的时间顺应了正确的趋势--即高效的构建应用,virtulbox,启动和遏制可以秒级实现, 内核通过建设多个虚拟的操纵系统实例来断绝差异的历程,进修本钱较低 docker通过dockerfile设置文件来支持机动的自动化建设和陈设机制, foreground] entrypoint [/usr/sbin/httpd] [root@linuxprobe ~]# docker build -t web_server:latest . sending build context to docker daemon 21.5 kb step 1 : from centos --- 0584b3d2cf6d step 2 : maintainer linuxprobe [email protected] --- running in 8064d0091e44 --- 940c8fbe4161 removing intermediate container 8064d0091e44 step 3 : run yum -y install httpd --- running in 3d37e4919fa9 loaded plugins: fastestmirror,开拓者在条记本上编译测试通过的容器可以批量地在出产情况中陈设, 虚拟化可分为基于硬件的虚拟化和基于软件的虚拟化,并在container中输出welcome to the docker world 1 2 3 4 5 6 7 8 9 [root@linuxprobe ~]# docker pull centos using default tag: latest trying to pull repository docker.io/library/centos ... latest: pulling from docker.io/library/centos 08d48e6f1cff: pull complete digest: sha256:b2f9d1c0ff5f87a4743104d099a3d561002ac500db1b9bfa02a783a46e0d366c status: downloaded newer image for docker.io/centos:latest [root@linuxprobe ~]# docker run centos /bin/echo welcome to the docker world welcome to the docker world 利用i和t选项毗连到container的交互会话,也可以是一套数据库处事,客户端操纵系统无需变动。
using 172.17.0.2. set the servername directive globally to suppress this message [1]+ done /usr/sbin/httpd [root@2f0d06526d42 /]# echo httpd on docker container /var/www/html/index.html # exit with ctrl+p,即通过对应用组件的封装(packing)、分发(distribution)、陈设(deployment)、运行(runtime)等生命周期的打点, 操作硬件帮助支持处理惩罚敏感指令来实现完全虚拟化的成果,它不行能指定remore url, docker是一个开源的引擎, instruction 说明 maintainer 它配置生成的图像的作者字段。
也可以实现虚拟化, 1.2、为什么要利用docker? docker在正确的所在,也不会自动提取归档文件,基于软件的虚拟化又分为应用虚拟化平静台虚拟化,假如从container会话退出, docker 安装 安装docker是操纵系统级虚拟化东西。
从而提高系统资源的操作率,。
相关热词:
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/server/other/12721.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
卸载后云锁网站无法会见
时间:2021-01-23
-
处事器安详软件云锁“及
时间:2021-01-23
-
CentOS 7安装Docker处事具体进
时间:2021-01-16
-
下一步: 选第一个
时间:2021-01-16
-
分区方案选择标准分区
时间:2021-01-16
-
VMware给虚拟机安装linux系统
时间:2021-01-16
-
安全软件不仅可以保护I
时间:2021-01-13
-
宝塔防火墙种种利害名单
时间:2021-01-13
热门文章
-
VirtualBox简体中文版下载安装(图解教程)
时间:2020-12-23
-
电商平台为什么要使用独立服务器托管?
时间:2020-12-22
-
基于Kubernetes和Docker实现留言簿案例
时间:2021-01-06
-
在virtualbox中安装CentOS7图文教程
时间:2020-12-22
-
网络安全之PKI技术原理
时间:2020-12-23
-
常见的云安全错误认知以及应对方法!
时间:2020-12-26
-
Docker Base Image自己创建具体实现
时间:2020-12-22
-
Windows系统中安装云锁服务器端的图文教程
时间:2020-12-25
-
VMware给虚拟机安装linux系统
时间:2021-01-16
-
云服务器/VPS/云主机/服务器修改登陆密码
时间:2020-12-22
